package com.example.project01;

import com.aliyun.oss.ClientBuilderConfiguration;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;


@SpringBootApplication
public class Project01Application {

	public static void main(String[] args) {
		SpringApplication.run(Project01Application.class, args);

	}

	@Bean
	public OSS ossClient() {
		var config = new ClientBuilderConfiguration();
		config.setMaxConnections(256);
		config.setIdleConnectionTime(30 * 1000);
		return new OSSClientBuilder().build(
				"http://oss-cn-shanghai.aliyuncs.com",
				"LTAI5tRf8aDY7fPR7fwgjnVN",
				"QZGCmcHetjzMm4vMNmwrECrIGHO8MW",
				config
		);
	}

}
